#ifndef __SOCKETTCP_H
#define __SOCKETTCP_H

#include <Address.h>
#include <types.h>
#include <Socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

 
class SocketTCP : public Socket
{
 private:
   enum SType type;
   struct sockaddr_in saddrl, saddrr;
   
 public:
   SocketTCP(SocketTCP &stcp);
   SocketTCP(Address addr, enum SType type=SOCK_CONNECT, int qlen=768);
   ~SocketTCP();
   
   int read(void *buf, size_t n);
   int write(void *buf, size_t n);
   SocketTCP *establish();
   void close();
   
};
#endif
